#ifndef IMAGECELL_H
#define IMAGECELL_H

#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QVBoxLayout>
#include <QStackedLayout>
#include <QWidget>
#include "BaseWidgets_global.h"

namespace UserManagementSystem {

///
/// \brief The ImageCell class
///这是上传图片类的cellimage，子窗口
class BASEWIDGETS_EXPORT ImageCell : public QWidget
{
    Q_OBJECT
public:
        ///@brief 维护两个地址读取图片
    QString m_addPicPath;
    QString m_deleteIconPath;
public:
    //父对象，是否有删除按钮
    explicit ImageCell(QWidget *parent = nullptr,bool has_delete=false,const QString pix_path="");


signals:
    ///@brief 删除按钮点击，触发删除图片的信号
    void On_Delete_Image();

    ///@brief 添加图片按钮点击，触发添加图片的信号
    void On_Add_Image();

protected:
    void mouseReleaseEvent(QMouseEvent* event) override;
private:
    ///@brief stackwidget
    QVBoxLayout* m_mainLayout=nullptr;

    ///@brief 是否带有删除图标
    bool m_hasDeleteBtn=false;

    ///@brief 一个label展示图片
    QLabel m_picture;

    QPushButton*  m_deleteBtn=nullptr;

    const int m_itemWidth=94;
};
}



#endif // IMAGECELL_H
